package com.cn.ycy.utils;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

public class JsonLongSerializer extends JsonSerializer {
    public JsonLongSerializer() {
    }

    public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
        Long a = Long.parseLong(JSON.toJSONString(value));
        gen.writeString(Long.toString(a));
    }
}
